package com.itheima.health.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.pojo.SmsLogin;
import com.itheima.health.pojo.Submit;
import com.itheima.health.service.MobileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/mobile")
public class MobileController {
    @Autowired
    private MobileService mobileService;
    /**
     * 手机端_体检预约_套餐展示
     */
    @GetMapping("/setmeal/getSetmeal")
    public Result getSetmeal(){
        return mobileService.getSetmeal();
    }
    /**
     * 根据id查询套餐详情
     */
    @GetMapping("/setmeal/findById")
    public Result findById(String id){
        return mobileService.findById(id);
    }
    /**
     *获取验证码
     */
    @PostMapping("/validateCode/send")
    public Result send(String type , String telephone){
        return mobileService.send(type,telephone);
    }
    /**
     *手机端验证码登录
     */
    @PostMapping("/login/smsLogin")
    public Result login(@RequestBody SmsLogin smsLogin){
        return mobileService.login(smsLogin);
    }

    @PostMapping("/order/submit")
    public Result submit(@RequestBody Submit submit){
        return mobileService.sumbit(submit);
    }
}
